package com.example.deal.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.example.deal.dao.DealRepository;
import com.example.deal.entity.Deal;

@RestController
public class DealController {
	@Autowired
	private DealRepository dealRepository;

	@GetMapping("/{id}")
	public Deal findById(@PathVariable Long id) {
		Deal findOne = this.dealRepository.getOne(id);
		return findOne;
	}
}